Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Regular tree grammar</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Regular_tree_grammar"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Regular_tree_grammar rootpage-Regular_tree_grammar skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Regular tree grammar</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>In <a href="Theoretical_computer_science" title="Theoretical computer science">theoretical computer science</a> and <a href="Formal_language_theory" class="mw-redirect" title="Formal language theory">formal language theory</a>, a <b>regular tree grammar</b> is a <a href="Formal_grammar" title="Formal grammar">formal grammar</a> that describes a set of <a href="Tree_(graph_theory)" title="Tree (graph theory)">directed trees</a>, or <a href="Term_(logic)" title="Term (logic)">terms</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> A <a href="Regular_grammar" title="Regular grammar">regular word grammar</a> can be seen as a special kind of regular tree grammar, describing a set of single-<a href="Path_(graph_theory)" title="Path (graph theory)">path</a> trees.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Definition">Definition</h2></div>
<p>A regular tree grammar <i>G</i> is defined by the tuple <i>G</i> = (<i>N</i>, Σ, <i>Z</i>, <i>P</i>), where:
</p>
<ul><li><i>N</i> is a finite set of nonterminals,</li>
<li>Σ is a <a href="Ranked_alphabet" title="Ranked alphabet">ranked alphabet</a> (i.e., an alphabet whose symbols have an associated <a href="Arity" title="Arity">arity</a>) disjoint from <i>N</i>,</li>
<li><i>Z</i> is the starting nonterminal, with <span class="texhtml"><i>Z</i> ∈ <i>N</i></span>, and</li>
<li><i>P</i> is a finite set of productions of the form <i>A</i> → <i>t</i>, with <span class="texhtml"><i>A</i> ∈ <i>N</i></span>, and <span class="texhtml"><i>t</i> ∈ <i>T</i><sub>Σ</sub>(<i>N</i>)</span>, where <i>T</i><sub>Σ</sub>(<i>N</i>) is the associated <a href="Term_algebra" title="Term algebra">term algebra</a>, i.e. the set of all trees composed from symbols in <span class="texhtml">Σ ∪ <i>N</i></span> according to their arities, where nonterminals are considered nullary.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Derivation_of_trees">Derivation of trees</h2></div>
<p>The grammar <i>G</i> implicitly defines a set of trees: any tree that can be derived from <i>Z</i> using the rule set <i>P</i> is said to be <b>described</b> by <i>G</i>.
This set of trees is known as the <b><a href="Formal_language" title="Formal language">language</a></b> of <i>G</i>.
Formally, the relation ⇒<sub><i>G</i></sub> on the set <i>T</i><sub>Σ</sub>(<i>N</i>) is defined as follows:
</p><p>A tree <span class="texhtml"><i>t</i><sub>1</sub>∈ <i>T</i><sub>Σ</sub>(<i>N</i>)</span> can be <b>derived in a single step</b> into a tree <span class="texhtml"><i>t</i><sub>2</sub> ∈ <i>T</i><sub>Σ</sub>(<i>N</i>)</span>
(in short: <i>t</i><sub>1</sub> ⇒<sub><i>G</i></sub> <i>t</i><sub>2</sub>), if there is a context <i>S</i> and a production <span class="texhtml">(<i>A</i>→<i>t</i>) ∈ <i>P</i></span> such that:
</p>
<ul><li><i>t</i><sub>1</sub> = <i>S</i>[<i>A</i>], and</li>
<li><i>t</i><sub>2</sub> = <i>S</i>[<i>t</i>].</li></ul>
<p>Here, a <i>context</i> means a tree with exactly one hole in it; if <i>S</i> is such a context, <i>S</i>[<i>t</i>] denotes the result of filling the tree <i>t</i> into the hole of <i>S</i>.
</p><p>The tree language generated by <i>G</i> is the language <span class="texhtml"><i>L</i>(<i>G</i>) = { <i>t</i> ∈ <i>T</i><sub>Σ</sub> | <i>Z</i> ⇒<sub><i>G</i>*</sub> <i>t</i> }</span>.
</p><p>Here, <i>T</i><sub>Σ</sub> denotes the set of all trees composed from symbols of Σ, while ⇒<sub><i>G</i>*</sub> denotes successive applications of ⇒<sub><i>G</i></sub>.
</p><p>A language generated by some regular tree grammar is called a <b>regular <a href="Tree_language" class="mw-redirect" title="Tree language">tree language</a></b>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>

<p>Let <i>G</i><sub>1</sub> = (<i>N</i><sub>1</sub>,Σ<sub>1</sub>,<i>Z</i><sub>1</sub>,<i>P</i><sub>1</sub>), where
</p>
<ul><li><i>N</i><sub>1</sub> = {<i>Bool</i>, <i>BList</i> } is our set of nonterminals,</li>
<li>Σ<sub>1</sub> = { <i>true</i>, <i>false</i>, <i>nil</i>, <i>cons</i>(.,.) } is our ranked alphabet, arities indicated by dummy arguments (i.e. the symbol <i>cons</i> has arity 2),</li>
<li><i>Z</i><sub>1</sub> = <i>BList</i> is our starting nonterminal, and</li>
<li>the set <i>P</i><sub>1</sub> consists of the following productions:
<ul><li><i>Bool</i> → <i>false</i></li>
<li><i>Bool</i> → <i>true</i></li>
<li><i>BList</i> → <i>nil</i></li>
<li><i>BList</i> → <i>cons</i>(<i>Bool</i>,<i>BList</i>)</li></ul></li></ul>
<p>An example derivation from the grammar <i>G</i><sub>1</sub> is
</p><p><i>BList</i>
⇒ <i>cons</i>(<i>Bool</i>,<i>BList</i>)
⇒ <i>cons</i>(<i>false</i>,<i>cons</i>(<i>Bool</i>,<i>BList</i>))
⇒ <i>cons</i>(<i>false</i>,<i>cons</i>(<i>true</i>,<i>nil</i>)).
</p><p>The image shows the corresponding <a href="Derivation_tree" class="mw-redirect" title="Derivation tree">derivation tree</a>; it is a tree of trees (main picture), whereas a derivation tree in <a href="Regular_grammar" title="Regular grammar">word grammars</a> is a tree of strings (upper left table).
</p><p>The tree language generated by <i>G</i><sub>1</sub> is the set of all finite lists of boolean values, that is, <i>L</i>(<i>G</i><sub>1</sub>) happens to equal <i>T</i><sub>Σ1</sub>.
The grammar <i>G</i><sub>1</sub> corresponds to the algebraic data type declarations (in the <a href="Standard_ML#Algebraic_datatypes" title="Standard ML">Standard ML</a> programming language):
</p>
<div class="mw-highlight mw-highlight-lang-sml mw-content-ltr" dir="ltr"><pre><span class="kr">datatype</span> <span class="kt">Bool</span>
<span class="p">=</span> <span class="nc">false</span>
<span class="p">|</span> <span class="nc">true</span>
<span class="kr">datatype</span> <span class="kt">BList</span>
<span class="p">=</span> <span class="nc">nil</span>
<span class="p">|</span> <span class="nc">cons</span> <span class="kr">of</span> <span class="n">Bool</span> <span class="n">*</span> <span class="n">BList</span>
</pre></div>
<p>Every member of <i>L</i>(<i>G</i><sub>1</sub>) corresponds to a Standard-ML value of type BList.
</p><p>For another example, let <span class="texhtml"><i>G</i><sub>2</sub> = (<i>N</i><sub>1</sub>, Σ<sub>1</sub>, <i>BList</i><sub>1</sub>, <i>P</i><sub>1</sub> ∪ <i>P</i><sub>2</sub>)</span>, using the nonterminal set and the alphabet from above, but extending the production set by <i>P</i><sub>2</sub>, consisting of the following productions:
</p>
<ul><li><i>BList</i><sub>1</sub> → <i>cons</i>(<i>true</i>,<i>BList</i>)</li>
<li><i>BList</i><sub>1</sub> → <i>cons</i>(<i>false</i>,<i>BList</i><sub>1</sub>)</li></ul>
<p>The language <i>L</i>(<i>G</i><sub>2</sub>) is the set of all finite lists of boolean values that contain <i>true</i> at least once. The set <i>L</i>(<i>G</i><sub>2</sub>) has no <b>datatype</b> counterpart in Standard ML, nor in any other functional language.
It is a proper subset of <i>L</i>(<i>G</i><sub>1</sub>).
The above example term happens to be in <i>L</i>(<i>G</i><sub>2</sub>), too, as the following derivation shows:
</p><p><i>BList</i><sub>1</sub>
⇒ <i>cons</i>(<i>false</i>,<i>BList</i><sub>1</sub>)
⇒ <i>cons</i>(<i>false</i>,<i>cons</i>(<i>true</i>,<i>BList</i>))
⇒ <i>cons</i>(<i>false</i>,<i>cons</i>(<i>true</i>,<i>nil</i>)).
</p>
<div class="mw-heading mw-heading2"><h2 id="Language_properties">Language properties</h2></div>
<p>If <i>L</i><sub>1</sub>, <i>L</i><sub>2</sub> both are regular tree languages, then the tree sets <span class="texhtml"><i>L</i><sub>1</sub> ∩ <i>L</i><sub>2</sub>, <i>L</i><sub>1</sub> ∪ <i>L</i><sub>2</sub></span>, and <i>L</i><sub>1</sub> \ <i>L</i><sub>2</sub> are also regular tree languages, and it is decidable whether <span class="texhtml"><i>L</i><sub>1</sub> ⊆ <i>L</i><sub>2</sub></span>, and whether <i>L</i><sub>1</sub> = <i>L</i><sub>2</sub>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Alternative_characterizations_and_relation_to_other_formal_languages">Alternative characterizations and relation to other formal languages</h2></div>
<ul><li>Regular tree grammars are a generalization of <a href="Regular_grammar" title="Regular grammar">regular word grammars</a>.</li>
<li>The regular tree languages are also the languages recognized by bottom-up <a href="Tree_automaton" title="Tree automaton">tree automata</a> and nondeterministic top-down tree automata.<sup id="cite_ref-Comon_2-0" class="reference"><a href="#cite_note-Comon-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup></li>
<li>Rajeev Alur and Parthasarathy Madhusudan related a subclass of regular binary tree languages to <a href="Nested_word" title="Nested word">nested words</a> and <a href="Visibly_pushdown_language" class="mw-redirect" title="Visibly pushdown language">visibly pushdown languages</a>.<sup id="cite_ref-Alur2004_3-0" class="reference"><a href="#cite_note-Alur2004-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Alur2009_4-0" class="reference"><a href="#cite_note-Alur2009-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Applications">Applications</h2></div>
<p>Applications of regular tree grammars include:
</p>
<ul><li><a href="Code_generation_(compiler)#Major_tasks_in_code_generation" title="Code generation (compiler)">Instruction selection</a> in compiler code generation<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup></li>
<li>A <a href="Decision_procedure" class="mw-redirect" title="Decision procedure">decision procedure</a> for the <a href="First-order_logic" title="First-order logic">first-order logic</a> <a href="Theory_(mathematical_logic)" title="Theory (mathematical logic)">theory</a> of formulas over <a href="First-order_logic#Equality_and_its_axioms" title="First-order logic">equality</a> (=) and <a href="Set_(mathematics)#Membership" title="Set (mathematics)">set membership</a> (∈) as the only <a href="First-order_logic#Non-logical_symbols" title="First-order logic">predicates</a><sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup></li>
<li>Solving <a href="Constraint_satisfaction_problem#Decision_problems" title="Constraint satisfaction problem">constraints</a> about mathematical sets<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup></li>
<li>The set of all truths expressible in first-order logic about a finite algebra (which is always a regular tree language)<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup></li>
<li>Graph-search <sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Set_constraint" title="Set constraint">Set constraint</a> – a generalization of regular tree grammars</li>
<li><a href="Tree-adjoining_grammar" title="Tree-adjoining grammar">Tree-adjoining grammar</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation citeseerx cs1">"Regular tree grammars as a formalism for scope underspecification". <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.164.5484">10.1.1.164.5484</a></span>.</cite></span>
</li>
<li id="cite_note-Comon-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-Comon_2-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFComonDauchetGilleronLöding2007" class="citation web cs1">Comon, Hubert; Dauchet, Max; Gilleron, Remi; Löding, Christof; Jacquemard, Florent; Lugiez, Denis; Tison, Sophie; Tommasi, Marc (12 October 2007). <a rel="nofollow" class="external text" href="http://www.grappa.univ-lille3.fr/tata">"Tree Automata Techniques and Applications"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">25 January</span> 2016</span>.</cite></span>
</li>
<li id="cite_note-Alur2004-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-Alur2004_3-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFAlurMadhusudan2004" class="citation book cs1">Alur, R.; Madhusudan, P. (2004). <a rel="nofollow" class="external text" href="http://www.cis.upenn.edu/~alur/Stoc04.pdf">"Visibly pushdown languages"</a> <span class="cs1-format">(PDF)</span>. <a rel="nofollow" class="external text" href="https://repository.upenn.edu/cgi/viewcontent.cgi?article=1174&amp;context=cis_papers"><i>Proceedings of the thirty-sixth annual ACM symposium on Theory of computing - STOC '04</i></a>. pp.&nbsp;<span class="nowrap">202–</span>211. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1007352.1007390">10.1145/1007352.1007390</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1581138528</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:7473479">7473479</a>.</cite> Sect.4, Theorem 5,</span>
</li>
<li id="cite_note-Alur2009-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-Alur2009_4-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFAlurMadhusudan2009" class="citation journal cs1">Alur, R.; Madhusudan, P. (2009). <a rel="nofollow" class="external text" href="http://www.cis.upenn.edu/~alur/Jacm09.pdf">"Adding nesting structure to words"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of the ACM</i>. <b>56</b> (3): <span class="nowrap">1–</span>43. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.145.9971">10.1.1.145.9971</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1516512.1516518">10.1145/1516512.1516518</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:768006">768006</a>.</cite> Sect.7</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFEmmelmann1991" class="citation conference cs1">Emmelmann, Helmut (1991). "Code Selection by Regularly Controlled Term Rewriting". <i>Code Generation - Concepts, Tools, Techniques</i>. Workshops in Computing. Springer. pp.&nbsp;<span class="nowrap">3–</span>29.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFComon1990" class="citation conference cs1">Comon, Hubert (1990). "Equational Formulas in Order-Sorted Algebras". <i>Proc. ICALP</i>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite id="CITEREFGilleronTisonTommasi1993" class="citation conference cs1">Gilleron, R.; Tison, S.; Tommasi, M. (1993). "Solving Systems of Set Constraints using Tree Automata". <i>10th Annual Symposium on Theoretical Aspects of Computer Science</i>. LNCS. Vol.&nbsp;665. Springer. pp.&nbsp;<span class="nowrap">505–</span>514.</cite></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite id="CITEREFBurghardt2002" class="citation conference cs1">Burghardt, Jochen (2002). "Axiomatization of Finite Algebras". <i>Advances in Artificial Intelligence</i>. LNAI. Vol.&nbsp;2479. Springer. pp.&nbsp;<span class="nowrap">222–</span>234. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1403.7347">1403.7347</a></span>. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2014arXiv1403.7347B">2014arXiv1403.7347B</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>3-540-44185-9</bdi>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite id="CITEREFZiv-Ukelson2016" class="citation conference cs1">Ziv-Ukelson, Smoly (2016). <i>Algorithms for Regular Tree Grammar Network Search and Their Application to Mining Human–viral Infection Patterns</i>. J. of Comp. Bio.</cite> <a rel="nofollow" class="external autonumber" href="https://www.liebertpub.com/doi/full/10.1089/cmb.2015.0168">[1]</a></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li>Regular tree grammars were already described in 1968 by:
<ul><li><cite id="CITEREFBrainerd1968" class="citation journal cs1">Brainerd, W.S. (1968). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fs0019-9958%2868%2990917-0">"The Minimalization of Tree Automata"</a>. <i>Information and Control</i>. <b>13</b> (5): <span class="nowrap">484–</span>491. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fs0019-9958%2868%2990917-0">10.1016/s0019-9958(68)90917-0</a></span>. <a href="Hdl_(identifier)" class="mw-redirect" title="Hdl (identifier)">hdl</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://hdl.handle.net/10945%2F40204">10945/40204</a></span>.</cite></li>
<li><cite id="CITEREFThatcherWright1968" class="citation journal cs1">Thatcher, J.W.; Wright, J.B. (1968). "Generalized Finite Automata Theory with an Application to a Decision Problem of Second-Order Logic". <i>Mathematical Systems Theory</i>. <b>2</b> (1): <span class="nowrap">57–</span>81. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2FBF01691346">10.1007/BF01691346</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:31513761">31513761</a>.</cite></li></ul></li>
<li>A book devoted to tree grammars is: <cite id="CITEREFNivatPodelski1992" class="citation book cs1">Nivat, Maurice; Podelski, Andreas (1992). <i>Tree Automata and Languages</i>. Studies in Computer Science and Artificial Intelligence. Vol.&nbsp;10. North-Holland.</cite></li>
<li>Algorithms on regular tree grammars are discussed from an efficiency-oriented view in: <cite id="CITEREFAikenMurphy1991" class="citation conference cs1">Aiken, A.; Murphy, B. (1991). "Implementing Regular Tree Expressions". <i>ACM Conference on Functional Programming Languages and Computer Architecture</i>. pp.&nbsp;<span class="nowrap">427–</span>447. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.39.3766">10.1.1.39.3766</a></span>.</cite></li>
<li>Given a mapping from trees to weights, <a href="Donald_Knuth" title="Donald Knuth">Donald Knuth</a>'s generalization of <a href="Dijkstra's_algorithm" title="Dijkstra's algorithm">Dijkstra's shortest-path algorithm</a> can be applied to a regular tree grammar to compute for each nonterminal the minimum weight of a derivable tree. Based on this information, it is straightforward to enumerate its language in increasing weight order. In particular, any nonterminal with infinite minimum weight produces the empty language. See: <cite id="CITEREFKnuth1977" class="citation journal cs1">Knuth, D.E. (1977). "A Generalization of Dijkstra's Algorithm". <i>Information Processing Letters</i>. <b>6</b> (1): <span class="nowrap">1–</span>5. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0020-0190%2877%2990002-3">10.1016/0020-0190(77)90002-3</a>.</cite></li>
<li>Regular tree automata have been generalized to admit equality tests between sibling nodes in trees. See: <cite id="CITEREFBogaertTison1992" class="citation conference cs1">Bogaert, B.; Tison, Sophie (1992). "Equality and Disequality Constraints on Direct Subterms in Tree Automata". <i>Proc. 9th STACS</i>. LNCS. Vol.&nbsp;577. Springer. pp.&nbsp;<span class="nowrap">161–</span>172.</cite></li>
<li>Allowing equality tests between deeper nodes leads to undecidability. See: <cite id="CITEREFTommasi1991" class="citation book cs1">Tommasi, M. (1991). <i>Automates d'Arbres avec Tests d'Égalités entre Cousins Germains</i>. LIFL-IT.</cite></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1126788409">
/* start https://en.wikipedia.org/ */


.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Automata_theory:_formal_languages_and_formal_grammars385" style="padding:3px"><table class="nowraplinks mw-collapsible mw-collapsed navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div id="Automata_theory:_formal_languages_and_formal_grammars385" style="font-size:114%;margin:0 4em"><a href="Automata_theory" title="Automata theory">Automata theory</a>: <a href="Formal_language" title="Formal language">formal languages</a> and <a href="Formal_grammar" title="Formal grammar">formal grammars</a></div></th></tr><tr><td colspan="2" class="navbox-list navbox-odd plainlist" style="width:100%;padding:0;background:transparent;color:inherit;"><div style="padding:0px"><table class="navbox-columns-table" style="border-spacing: 0px; text-align:left;width:100%;"><tbody><tr><td class="navbox-abovebelow" style="font-weight:bold;"><a href="Chomsky_hierarchy" title="Chomsky hierarchy">Chomsky hierarchy</a></td><td class="navbox-abovebelow" style="border-left:2px solid #fdfdfd;font-weight:bold;"><a href="Formal_grammar" title="Formal grammar">Grammars</a></td><td class="navbox-abovebelow" style="border-left:2px solid #fdfdfd;font-weight:bold;"><a href="Formal_language" title="Formal language">Languages</a></td><td class="navbox-abovebelow" style="border-left:2px solid #fdfdfd;font-weight:bold;"><a href="Abstract_machine" title="Abstract machine">Abstract machines</a></td></tr><tr style="vertical-align:top"><td class="navbox-list" style="padding:0px;text-align: center;width:10em;"><div>
<ul><li>Type-0</li>
<li>—</li>
<li>Type-1</li>
<li>—</li>
<li>—</li>
<li>—</li>
<li>—</li>
<li>—</li>
<li>Type-2</li>
<li>—</li>
<li>—</li>
<li>Type-3</li>
<li>—</li>
<li>—</li></ul>
</div></td><td class="navbox-list" style="border-left:2px solid #fdfdfd;padding:0px;width:10em;"><div>
<ul><li><a href="Unrestricted_grammar" title="Unrestricted grammar">Unrestricted</a></li>
<li>(no common name)</li>
<li><a href="Context-sensitive_grammar" title="Context-sensitive grammar">Context-sensitive</a></li>
<li><span style="white-space:nowrap;">Positive <a href="Range_concatenation_grammars" class="mw-redirect" title="Range concatenation grammars">range concatenation</a></span></li>
<li><a href="Indexed_grammar" title="Indexed grammar">Indexed</a></li>
<li>—</li>
<li><a href="Linear_context-free_rewriting_system" class="mw-redirect" title="Linear context-free rewriting system">Linear context-free rewriting systems</a></li>
<li><a href="Tree-adjoining_grammar" title="Tree-adjoining grammar">Tree-adjoining</a></li>
<li><a href="Context-free_grammar" title="Context-free grammar">Context-free</a></li>
<li><a href="Deterministic_context-free_grammar" title="Deterministic context-free grammar">Deterministic context-free</a></li>
<li><a href="Nested_word" title="Nested word">Visibly pushdown</a></li>
<li><a href="Regular_grammar" title="Regular grammar">Regular</a></li>
<li>—</li>
<li><a href="Non-recursive_grammar" class="mw-redirect" title="Non-recursive grammar">Non-recursive</a></li></ul>
</div></td><td class="navbox-list" style="border-left:2px solid #fdfdfd;padding:0px;width:10em;"><div>
<ul><li><a href="Recursively_enumerable_language" title="Recursively enumerable language">Recursively enumerable</a></li>
<li><a href="Recursive_language" title="Recursive language">Decidable</a></li>
<li><a href="Context-sensitive_language" title="Context-sensitive language">Context-sensitive</a></li>
<li><span style="white-space:nowrap;">Positive <a href="Range_concatenation_language" class="mw-redirect" title="Range concatenation language">range concatenation</a><sup>*</sup></span></li>
<li><a href="Indexed_language" title="Indexed language">Indexed</a><sup>*</sup></li>
<li>—</li>
<li><a href="Linear_context-free_rewriting_language" class="mw-redirect" title="Linear context-free rewriting language">Linear context-free rewriting language</a></li>
<li><a href="Tree-adjoining_grammar" title="Tree-adjoining grammar">Tree-adjoining</a></li>
<li><a href="Context-free_language" title="Context-free language">Context-free</a></li>
<li><a href="Deterministic_context-free_language" title="Deterministic context-free language">Deterministic context-free</a></li>
<li><a href="Nested_word" title="Nested word">Visibly pushdown</a></li>
<li><a href="Regular_language" title="Regular language">Regular</a></li>
<li><a href="Star-free_language" title="Star-free language">Star-free</a></li>
<li><a href="Finite_language" class="mw-redirect" title="Finite language">Finite</a></li></ul>
</div></td><td class="navbox-list" style="border-left:2px solid #fdfdfd;padding:0px;width:10em;"><div>
<ul><li><a href="Turing_machine" title="Turing machine">Turing machine</a></li>
<li><a href="Decider_(Turing_machine)" title="Decider (Turing machine)">Decider</a></li>
<li><a href="Linear_bounded_automaton" title="Linear bounded automaton">Linear-bounded</a></li>
<li><a href="PTIME" class="mw-redirect" title="PTIME">PTIME</a> Turing Machine</li>
<li><a href="Nested_stack_automaton" title="Nested stack automaton">Nested stack</a></li>
<li><a href="Thread_automaton" title="Thread automaton">Thread automaton</a></li>
<li>restricted <a href="Tree_stack_automaton" title="Tree stack automaton">Tree stack automaton</a></li>
<li><a href="Embedded_pushdown_automaton" title="Embedded pushdown automaton">Embedded pushdown</a></li>
<li><a href="Pushdown_automaton" title="Pushdown automaton">Nondeterministic pushdown</a></li>
<li><a href="Deterministic_pushdown_automaton" title="Deterministic pushdown automaton">Deterministic pushdown</a></li>
<li><a href="Nested_word" title="Nested word">Visibly pushdown</a></li>
<li><a href="Finite-state_machine" title="Finite-state machine">Finite</a></li>
<li><a href="Aperiodic_finite_state_automaton" class="mw-redirect" title="Aperiodic finite state automaton">Counter-free (with aperiodic finite monoid)</a></li>
<li><a href="Deterministic_acyclic_finite_state_automaton" title="Deterministic acyclic finite state automaton">Acyclic finite</a></li></ul>
</div></td></tr></tbody></table></div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div><span style="white-space:nowrap;">Each category of languages, except those marked by a <sup>*</sup>, is a <a href="Proper_subset" class="mw-redirect" title="Proper subset">proper subset</a> of the category directly above it.</span> <span style="white-space:nowrap;">Any language in each category is generated by a grammar and by an automaton in the category in the same line.</span></div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-07" href="https://en.wikipedia.org/wiki/?title=Regular_tree_grammar&amp;oldid=1299311241">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>